package com.example.design.factory.version6.exercise02;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class BeanPropertiesUtils {

    public  static Properties properties=new Properties();

    static {
        InputStream in=Thread.currentThread().getContextClassLoader().getResourceAsStream("com/example/design/factory/version6/exercise02/bean.properties");

        try {
            properties.load(in);  //加载配置文件
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public  static  String getClassname(String key){
        return  properties.getProperty(key);
    }

    public static void main(String[] args) {
        System.out.println(BeanPropertiesUtils.getClassname("root"));
    }
}
